﻿
var db = require('../db/db.js');

async function header (req) {
   // console.log(req.originalUrl);
    var obj = await db.query("select * from system_menu where nvaurl=?", [req.originalUrl]);
    var menu = {

    }
    if (obj.length > 0) {
        menu = obj[0];
        var parentmenu = await db.query("select * from system_menu where id=?", [menu.parentid]);
        menu.parentstr = parentmenu[0].textstr;
     
    }
    return menu;
    //console.log(menu);

  
}
module.exports = { header};